import React from 'react'
import { useLocation, useNavigate } from 'react-router-dom'
import {  NavBar,Dropdown } from 'antd-mobile'
function Index() {
  let location = useLocation()
  console.log('location',location)
  const detailData=location.state
  const navigate=useNavigate()
  const goOrder=()=>{
      navigate('/detailData')
  }
  return (
    <div>
     <dl key={detailData.id} onClick={()=>goOrder()}> 
         <dt >
            <img src={detailData.url} alt=""  style={{width:'100%',height:'200px'}} />
         </dt>
         <dd >
             <h4>{detailData.name}</h4>
             <h4>{detailData.title}</h4>
             <h4>￥{detailData.price}</h4>
         </dd>
      </dl>
    </div>
  )
}

export default Index
